<?php
class indexController extends Controller{
	public function __construct(){
		parent::__construct();
		VG::$project_debug=false;
		
	}
    public function login($tpl){
	
		if(isset($_SESSION['MY_DEV'])){
            jump('dev/frameset/index/index');//跳至后台首页
        }
	
		if($_POST){
			
			$username=trim($_POST['username']);
			$password=trim($_POST['password']);
			if($username==''){
				msg(0,'账号不能为空！');
			}
			if($password==''){
				msg(0,'密码不能为空！');
			}
			
			if($username!='szh'){
				msg(0,'账号不存在！');
			}
			if($password!=date("Ymd")){
				msg(0,'密码不正确!');
			}
			

			
			$big_priv=array();
			
			
			$_SESSION['MY_DEV']=array();
			$_SESSION['MY_DEV']['ISLOGIN']=1;
			$_SESSION['MY_DEV']['ID']=1;
			$_SESSION['MY_DEV']['USER_NAME']='szh';
			$_SESSION['MY_DEV']['GROUPID']=1;
			$_SESSION['MY_DEV']['PRIV']=$big_priv;

		
			
			jump('dev/frameset/index/index');//跳至后台首页
		}

        include $tpl;
    }

}
